module.exports = (app) => {
  const { router, controller, middleware } = app;
  const subRouter = router.namespace("/role");
  const auth = middleware.authToken();

  subRouter.post(
    "/getRoleMenuByRoleId",
    auth,
    controller.role.getRoleMenuByRoleId
  );
  subRouter.post("/getRoleList", auth, controller.role.getRoleList);
  subRouter.post("/createRole", auth, controller.role.addRoleMenuList);
  subRouter.post("/updateRole", auth, controller.role.updateRoleAndMenuList);
  subRouter.post("/deleteRole", auth, controller.role.deleteRole);
  subRouter.get("/getAllRole", auth, controller.role.getAllRole);
};
